﻿@using Webdiyer.WebControls.Mvc;
@model PagedList<Inspinia_MVC5.Models.Book>

@{
    ViewBag.Title = "图书列表";
}

<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <h2>图书信息列表</h2>
        <ol class="breadcrumb">
            <li class="active">
                <strong>图书信息</strong>
            </li>
        </ol>
    </div>
</div>



<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>图书信息</h5>
                    <div class="ibox-tools">
                        @Html.ActionLink("录入图书", "Create", null, new { @class = "btn btn-primary btn-xs" })
                        <h1>    @ViewBag.Code </h1>
                    </div>
                </div>
                <div class="ibox-content" style="overflow:hidden;">
                    @using (Ajax.BeginForm("Index", "Books", new AjaxOptions { UpdateTargetId = "articles" }, new { @class = "form-inline", style = "float:left;padding-left:40px;" }))
                    {

                        <div class="input-group">
                            <input type="text" name="name" placeholder="图书名称" id="exampleInputEmail2" class="form-control"> <span class="input-group-btn">
                                <button type="submit" class="btn btn-primary">
                                    检索
                                </button>
                            </span>
                        </div>
                        @*<div class="form-group">
                <label for="exampleInputEmail2" class="sr-only">图书名称</label>
                <input type="text" name="name" placeholder="图书名称" id="exampleInputEmail2" class="form-control">
            </div>
            <button class="btn btn-white" type="submit">检索</button>*@
                    }
                    @using (Ajax.BeginForm("Index", "Books", new AjaxOptions { UpdateTargetId = "articles" }, new { @class = "form-inline", style = "float:left;padding-left:40px;" }))
                    {
                        <div class="input-group">
                            <input type="text" name="isbn" placeholder="ISBN" id="exampleInputPassword2" class="form-control"> <span class="input-group-btn">
                                <button type="submit" class="btn btn-primary">
                                    检索
                                </button>
                            </span>
                        </div>
                        @*<div class="form-group">
                            <label for="exampleInputPassword2" class="sr-only">ISBN</label>
                            <input type="text" name="isbn" placeholder="ISBN" id="exampleInputPassword2" class="form-control">
                        </div>
                        <button class="btn btn-white" type="submit">检索</button>*@
                    }
                    @*@using (Ajax.BeginForm("Index", "Books", new AjaxOptions { UpdateTargetId = "articles" }, new { @class = "form-inline", style = "float:left;padding-left:40px;" }))
        {
            <div class="form-group">
                <label for="exampleInputPassword2" class="sr-only">ISBN</label>
                <input type="text" name="isbn" placeholder="ISBN" id="exampleInputPassword2" class="form-control">
            </div>
            <button class="btn btn-white" type="submit">检索</button>
        }*@
                    <button style="margin-left:30px" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal1" onclick="return false"><i class="fa fa-cart-plus"></i> 识别条码</button>
                    @*<form role="form" method="get" action="/Books/Borrow" class="form-inline" style="float:left">
            <div class="form-group">
                <label for="exampleInputEmail2" class="sr-only">图书名称</label>
                <input type="text" name="name" placeholder="图书名称" id="exampleInputEmail2" class="form-control">
            </div>
            <button class="btn btn-white" type="submit">检索</button>
        </form>
        <form role="form" method="get" action="/Books/Borrow" class="form-inline" style="float:left;padding-left:40px;">
            <div class="form-group">
                <label for="exampleInputPassword2" class="sr-only">ISBN</label>
                <input type="text" name="isbn" placeholder="ISBN" id="exampleInputPassword2" class="form-control">
            </div>
            <button class="btn btn-white" type="submit">检索</button>
        </form>*@
                </div>
                <div class="ibox-content">
                    <div id="articles">
                        @Html.Partial("_BooksList", Model)
                    </div>
                    @section scripts
{
                        @{Html.RegisterMvcPagerScriptResource();}
                        <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
                        

                    }
                    @*<table class="table table-striped">
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.BookType.TypeName)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookName)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BokISBN)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookAuthor)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookPress)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookPic)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookMoney)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookOverdue)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Status)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookNum)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookDesc)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BookJieYueLiang)
                </th>
                <th></th>
            </tr>

            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookType.TypeName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BokISBN)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookAuthor)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookPress)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookPic)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookMoney)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookOverdue)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Status)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookNum)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookDesc)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BookJieYueLiang)
                    </td>
                    <td>
                        @Html.ActionLink("Details", "Details", new { id = item.ID }, new { @class = "btn btn-primary btn-sm" })
                        @Html.ActionLink("Edit", "Edit", new { id = item.ID }, new { @class = "btn btn-white btn-sm" })
                        @Html.ActionLink("Delete", "Delete", new { id = item.ID }, new { @class = "btn btn-white btn-sm" })
                    </td>
                </tr>
            }

        </table>*@

                </div>
            </div>
        </div>
    </div>
</div>


